import request from '@/utils/system/request'

// 获取所有的折叠菜单
export function getData(data: object) {
	return request({
		url: '/sys/menu/search',
		method: 'post',
		data
	})
}

// 新增
export function update(data: object) {
	return request({
		url: '/sys/menu',
		method: 'post',
		data
	})
}

// 通过角色id 获取所有的折叠菜单
export function getMenuByRoleId(data: string) {
	return request({
		url: `/sys/menu/role/${data}`,
		method: 'get'
	})
}

// 获取可以选择的菜单
export function superior(id: string) {
	return request({
		url: `/sys/menu/superior/${id}`,
		method: 'get',
	})
}

// 删除
export function del(id: string) {
	return request({
		url: `/sys/menu/${id}`,
		method: 'delete',
	})
}